import request from "@/utils/homeRequest";
import access_token from "@/utils/access_token";

// 获取轮播图数据
export const getBannerlistInfo = () => {
  return request.get(`/promotion/ads/search/findByPosition?access_token=${access_token}&position=pc_mainpage`);
}

// 获取推荐列表数据
export const getRecommendListInfo = (pageSize:number, pageNum:number, localCache:number) => {
  return request.get(`/moment/moments/rec/default?access_token=${access_token}&column=recommend&pageSize=${pageSize}&pageNum=${pageNum}&localCache=${localCache}`);
}

// 获取动态列表数据
export const getDynamicListInfo = (pageSize:number, pageNum:number) => {
  return request.get(`/moment/moments/frontDynamic/default?access_token=${access_token}&pageSize=${pageSize}${ pageNum ? `&pageNum=${pageNum}` : '' }&column=frontDynamic`);
}

// 获取作品、教程、专题列表数据
export const getProductionListInfo = (pageSize: number, pageNum:number, listLabel: string, listLabel2: string, data: object) => {
  return request.post(`/moment/moments/collect/${listLabel}/${listLabel2}?access_token=${access_token}&pageSize=${pageSize}&pageNum=${pageNum}&column=${listLabel}`, data);
}

// 获取作品页过滤列表的数据
export const getFilterListData = (filterLabel:string) => {
  return request.get(`/moment/properties/filter/${filterLabel}?access_token=${access_token}`)
}